using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using NUnit.Framework;

namespace Universe.Threading.Test
{
    class CompareUtil
    {
        internal static void IsEquals(IEnumerable expected, IEnumerable actual, string message)
        {
            Trace.WriteLine(message);
            Assert.AreEqual(JoinEnumerable(expected), JoinEnumerable(actual), message);
        }

        internal static string JoinEnumerable(IEnumerable enumerable)
        {
            StringBuilder ret = new StringBuilder();
            foreach (object t in enumerable)
            {
                ret.Append(ret.Length == 0 ? "" : " ").Append(t.ToString());
            }

            return ret.ToString();
        }
    }
}
